const fp = require('lodash/fp');
const fn = fp.flowRight(fp.join('-'),fp.map(fp.toLower),fp.split(' '))
console.log(fn('SWH HHH EWRRWR'))